package com.example.tool.dao.entity;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.NotNull;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Transient;
import org.greenrobot.greendao.annotation.Unique;

/**
 * 描述:人物表
 *
 * @author: liangkun
 * @date: 2019/9/29 11:16
 */
@Entity(nameInDb = "Person")  //@Entity 将我们的java普通类变为一个能够被greenDAO识别的数据库类型的实体类
public class Person {
    @Id  //@Id：主键，通过这个注解标记的字段必须是Long类型的，这个字段在数据库中表示它就是主键，并且它默认就是自增的
    @Unique  //唯一
    @Property(nameInDb = "PERSON_ID")  //@Property：设置一个非默认关系映射所对应的列名，默认是使用字段名，例如：@Property(nameInDb = "name")
    private String personId; //身份证
    @Property(nameInDb = "PERSON_YEAR")
    private String personYear; //出生年
    @Property(nameInDb = "PERSON_MONTH")
    private String personMonth; //出生月
    @Property(nameInDb = "PERSON_DAY")
    private String personDay; //出生日
    @Property(nameInDb = "PERSON_AGE")
    private int personAge; //年龄
    @Property(nameInDb = "PERSON_GENDER")
    private String personGender; //性别
    @NotNull    // @NotNull 设置数据库表当前列不能为空
    @Property(nameInDb = "PERSON_NAME")
    private String personName; //性别
    @Property(nameInDb = "PERSON_BIRTHDAY")
    private String personBirthday; //出生年月
    //@Transient：表明这个字段不会被写入数据库，只是作为一个普通的java类字段，用来临时存储数据的，不会被持久化
    @Transient
    private String job; //工作职业

    @Generated(hash = 1024547259)
    public Person() {
    }

    @Generated(hash = 1400202196)
    public Person(String personId, String personYear, String personMonth, String personDay, int personAge,
            String personGender, @NotNull String personName, String personBirthday) {
        this.personId = personId;
        this.personYear = personYear;
        this.personMonth = personMonth;
        this.personDay = personDay;
        this.personAge = personAge;
        this.personGender = personGender;
        this.personName = personName;
        this.personBirthday = personBirthday;
    }

    public String getPersonId() {
        return this.personId;
    }

    public void setPersonId(String personId) {
        this.personId = personId;
    }

    public String getPersonYear() {
        return this.personYear;
    }

    public void setPersonYear(String personYear) {
        this.personYear = personYear;
    }

    public String getPersonMonth() {
        return this.personMonth;
    }

    public void setPersonMonth(String personMonth) {
        this.personMonth = personMonth;
    }

    public String getPersonDay() {
        return this.personDay;
    }

    public void setPersonDay(String personDay) {
        this.personDay = personDay;
    }


    public String getPersonGender() {
        return this.personGender;
    }

    public void setPersonGender(String personGender) {
        this.personGender = personGender;
    }

    public String getPersonName() {
        return this.personName;
    }

    public void setPersonName(String personName) {
        this.personName = personName;
    }

    public String getPersonBirthday() {
        return this.personBirthday;
    }

    public void setPersonBirthday(String personBirthday) {
        this.personBirthday = personBirthday;
    }

    public int getPersonAge() {
        return this.personAge;
    }

    public void setPersonAge(int personAge) {
        this.personAge = personAge;
    }

}
